home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
19
/
madtrb11.zip
/
MX80.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-08-05
|
5KB
|
126 lines
Program MX80;
{
Epson MX80 printer controller/ASCII file lister
Source: "MX80: Controlling the Epson/IBM Printer", TUG Lines Volume I Issue 3
Author: Stan Dudek
Application: All systems using Epson MX80 and compatibles
}
Var Line_cnt, i, Page : Integer;
Option : String [1];
FileName : String [15];
Temp : String [255];
Source : Text;
Procedure Menu; { Main Menu used in the program. }
begin
writeln('Printer Utility with Text File Listing. ver. 1.00');
for i := 1 to 10 DO
write('________') { Draw a line on the screen. };
write(' ');
writeln('[ This program will Abort on Errors ]');
writeln(' 1 := Mode 132 Characters / Line.'); writeln;
writeln(' 2 := Mode 80 Characters / Line.'); writeln;
writeln(' 3 := Turn ON the Double Strike Mode.'); writeln;
writeln(' 4 := Turn OFF the Double Strike Mode.'); writeln;
writeln(' 5 := Type a message on the printer.'); writeln;
writeln(' 6 := Print a Text File. '); writeln;
writeln(' 7 := To EXIT Program. [ ]');
Page := 0; { set the page number equal to zero }
end; { of Menu Procedure }
Procedure Get_File;
begin
GotoXY (1,22); { position the cursor under the menu. }
write('Enter the File name to list: ');
readln(FileName);
Assign(Source,FileName);
Reset(Source);
end; { of Get File Procedure }
Procedure Read_Print;
Var Seed: integer;
Procedure Title; { Prints the program name and page number on each page. }
begin
Page := Page + 1; { increment the page number }
write(Lst, char(27),char(71)); { Double Strike Mode ON }
write(Lst, 'Program Name: ');
write(Lst, FileName);
write(Lst, ' Page ',Page);
{ Warning: The next writeln command will turn OFF the Double Strike mode. }
{ If you want Double Strike output, do not include the next line. }
writeln(Lst, char(27),char(72)); { Double Strike Mode OFF }
writeln(Lst, ''); { print a blank line }
Line_cnt := 2; { set the line number to two }
end; { of Title procedure }
Procedure Page_Feed;
begin
for i := Line_cnt to 66 DO { 66 lines / page, Title will start at 2 }
writeln(Lst,'');
Title; { print the title on the new page }
end; { of Page Feed Procedure }
begin
write('Enter the starting line of printer: ');
readln(Seed);
Title; { start page with the title }
Line_cnt := Seed; { set the line counter to the input value }
repeat
readln(Source,Temp); { read one line of text from the file }
writeln(Lst,Temp); { write one line of text to the printer }
write('.'); { print a dot for every line printed }
Line_cnt := Line_cnt + 1; { increment the line counter }
if Line_cnt > 59 then Page_Feed; { test for end of page condition }
until EOF(Source);
close(Source);
end; { of Read Print Procedure }
Procedure Print_Msg; { write a one line message to the printer }
begin
GotoXY (1,22); { position the cursor }
writeln('Enter message to Type on the Printer: ');
readln(Temp);
writeln(Lst,Temp);
ClrScr; { Clear the screen and . . . }
Menu; { re-paint the menu. }
end; { of Print Msg Procedure }
Procedure List_It; { list a file to the printer }
begin
Get_File;
Read_Print;
ClrScr;
Menu;
end; { of List It Procedure }
Procedure Action;
begin Case Option OF { the following codes are for an Epson MX80 }
'1' : writeln (Lst, Char(15)); { 132 characters per line. }
'2' : writeln (Lst, Char(18)); { 80 characters per line. }
'3' : writeln(Lst,char(27),char(71)); { Double Strike ON }
'4' : writeln(Lst,char(27),char(72)); { Double Strike OFF }
'5' : Print_Msg;
'6' : List_It;
end { of Case }; end { of Action Procedure };
begin { Main of Program Starts here. }
Menu;
Repeat
GotoXY (35,16);
readln(Option);
Action;
GotoXY (35,16);
write (' '); { Blank out the last selection number }
Until Option = '7';
ClrScr;
end { of Program. BYE! }.